const Koa = require('koa')
const wechat = require("./wechat-lib/middleware")

const config = require("./config/config")
const reply = require("./wechat/reply")

const { initSchema,connect} = require('./app/database/init')



;(async () => {

    await connect(config.db)
    initSchema()
//测试数据库

const { test } = require('./wechat/index')
    await test()

    const app = new Koa()

    app.use(wechat(config.wehchat,reply.reply))

    app.listen(3006)
    console.log('listen: ' + 3006 )

})()

